package com.mmy.service.oa.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.oa.RewardInfoRepository;
import com.mmy.dao.oa.VSysRewardInfoRepository;
import com.mmy.domain.oa.RewardInfo;
import com.mmy.domain.oa.VSysRewardInfo;
import com.mmy.service.oa.RewardInfoService;

@Service
public class RewardInfoServiceImpl implements RewardInfoService {

	@Autowired
	RewardInfoRepository rewardInfoRepository;

	@Autowired
	VSysRewardInfoRepository vSysRewardInfoRepository;

	/**
	 * 查找全部
	 * 
	 * @param
	 * @return
	 */
	public List<VSysRewardInfo> findAll() {
		// TODO Auto-generated method stub
		return vSysRewardInfoRepository.findAll();
	}

	/**
	 * 获取最大值
	 * 
	 * @param
	 * @return
	 */
	public Object getMaxRewardID() {
		// TODO Auto-generated method stub
		return rewardInfoRepository.getMaxRewardID();
	}

	/**
	 * 新增id
	 * 
	 * @param
	 * @return
	 */
	public void save(int rewardID) {
		// TODO Auto-generated method stub
		rewardInfoRepository.save(rewardID);
	}

	/**
	 * 新增
	 * 
	 * @param
	 * @return
	 */
	public void save(RewardInfo rewardInfo) {
		// TODO Auto-generated method stub
		rewardInfoRepository.save(rewardInfo);
	}

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */

	public void delRewardInfo(List<Integer> lstRewardID) {
		// TODO Auto-generated method stub
		rewardInfoRepository.delRewardInfo(lstRewardID);
	}

	/**
	 * 通过id查找
	 * 
	 * @param
	 * @return
	 */
	public RewardInfo findByRewardID(int iRewardID) {
		// TODO Auto-generated method stub
		return rewardInfoRepository.findByRewardID(iRewardID);
	}

	public List<VSysRewardInfo> findByTypeName(String strTypeName) {
		// TODO Auto-generated method stub
		return vSysRewardInfoRepository.findByTypeName(strTypeName);
	}
}
